import { Row, Col ,Form, Input, Button, Checkbox, message} from 'antd';
import { useEffect,useRef } from 'react';
import { useParams } from 'react-router';
import {Dea} from '../../apis/visitors/audit'
import '../../static/css/visitors/detail.css'
const ViDetail = () => {
    const {id}:any = useParams()
    const From:any = useRef()
    // 根据id查询单条访客记录
    const selId =async ()=>{
        const res:any = await Dea(id)
        if(res.code=='00000'){
            From.current.setFieldsValue(res.data)
        }else{
            message.error(res.msg,2)
        }
    }
    useEffect(()=>{
        selId()
    })
    const onFinish = (values: any) => {
        console.log('Success:', values);
      };
    
    const onFinishFailed = (errorInfo: any) => {
    console.log('Failed:', errorInfo);
    };
    return (
        <div style={{ backgroundColor: '#fff',}}>
            <Row className='size'>
                <Col span={1}></Col>
                <Col span={8}>
                    <Form
                        name="basic"
                        labelCol={{ span: 8 }}
                        wrapperCol={{ span: 16 }}
                        initialValues={{ remember: true }}
                        onFinish={onFinish}
                        onFinishFailed={onFinishFailed}
                        autoComplete="off"
                        ref={From}
                    >
                        <Form.Item
                            label="访客名"
                            name="username"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="部门"
                            name="department"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="手机号"
                            name="mobile"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="身份证号"
                            name="card"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="车牌号"
                            name="carnumber"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="进校时间"
                            name="addtime"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="离校时间"
                            name="endtime"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="状态"
                            name="status"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="类型"
                            name="type"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="是否去过高风险地区"
                            name="is_leave"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="是否接触过高风险地区"
                            name="is_send"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="是否离京"
                            name="iscancel"
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>
                        <Form.Item
                            label="地址"
                            name='address'
                        >
                            <Input bordered={false} disabled/>
                        </Form.Item>    
                    </Form>
                </Col>
                <Col span={8} style={{paddingLeft:'150px'}}>col-8</Col>
            </Row>
        </div>
    )
}
export default ViDetail